tmp                           = load([pwd,'/ModelSpecification/setupModel'],'setupModel');
setupProj.n_nodes             = n_nodes;
setupProj.epsi_nodes          = epsi_nodes';
setupProj.weight_nodes        = weight_nodes';
setupProj.appOrder            = appOrder;
setupProj.appOrderVar         = appOrderVar;
setupProj.endoMeanGrid        = endoMeanGrid;
setupProj.muGrid              = muGrid;
setupProj.gridFactor_x        = gridFactor_x;
setupProj.setupModel          = tmp.setupModel;
setupProj.optimizer           = 1 ;
if seOn == 1
    setupProj.dispOn          = 0;
else
    setupProj.dispOn          = 1*0;
end
setupProj.maxNumEval          = 10000;
setupProj.MaxIter             = 100; 
if appOrder == 3
    setupProj.tolF                = 1D-5;
    setupProj.tolX                = 1D-5;
else
    setupProj.tolF                = 1D-7;
    setupProj.tolX                = 1D-7;
end

setupFilter.setupProj         = setupProj;
setupFilter.selectParams      = selectParams;
setupFilter.calibrateParams   = calibrateParams;
setupFilter.data              = structData.data;
setupFilter.yieldsAll         = structData.yieldsAll;
setupFilter.NBERrec           = structData.NBERrec;
setupFilter.acm_tp            = structData.acm_tp;
setupFilter.pdCash            = structData.pdCash;
setupFilter.pdMarket          = structData.pdMarket;
setupFilter.retCash           = structData.retCash;
setupFilter.retMarket         = structData.retMarket;
setupFilter.rfCRSP            = structData.rfCRSP;
setupFilter.sentimentMich     = structData.sentimentMich;
setupFilter.sentimentOECD     = structData.sentimentOECD;
setupFilter.dataLabels        = structData.dataLabels;
setupFilter.timeIndex         = structData.timeIndex;
setupFilter.maturities        = structData.maturities;
setupFilter.matConShortRate   = structData.matConShortRate;
setupFilter.numMacro          = structData.numMacro;
setupFilter.nyMom             = nyMom;
setupFilter.realYields        = structData.realYields;
setupFilter.maturitiesReal    = structData.maturitiesReal;
setupFilter.optim             = optim;
setupFilter.MaxIter           = MaxIter;
setupFilter.MaxEvals          = MaxEvals;
setupFilter.TolFun            = TolFun;
setupFilter.TolX              = TolX;
setupFilter.lowerBoundsValues = struc2values(lowerBounds,setupFilter.selectParams);
setupFilter.upperBoundsValues = struc2values(upperBounds,setupFilter.selectParams);
setupFilter.InsigmaValues     = struc2values(Insigma,setupFilter.selectParams);
setupFilter.epsValue          = epsValue;
setupFilter.seOn              = seOn;
setupFilter.numInitial        = 4;
setupFilter.dataMoments       = dataSMM.dataMoments;
setupFilter.maturites_CS      = dataSMM.maturities_CS;
setupFilter.W                 = W;
setupFilter.tau               = tau;
setupFilter.CSdata            = CSdata;
setupFilter.CSregress_m       = CSregress_m;
setupFilter.SMMwithCSreg      = SMMwithCSreg;
setupFilter.numCPUs           = numCPUs;
setupFilter.MEXon             = MEXon;
setupFilter.cmaesPopSize      = cmaesPopSize;
setupFilter.cmaesSigma        = cmaesSigma; 
setupFilter.cmaesSigmaMax     = cmaesSigmaMax;
setupFilter.T                 = size(structData.data,1);
setupFilter.burnIn            = 1000;
setupFilter.numSim            = setupFilter.T*setupFilter.tau+setupFilter.burnIn; 
rng(1,'twister')
shocks                        = randn(5,1D5);
shocks                        = (shocks-mean(shocks,2))./repmat(std(shocks,0,2),1,1D5);
noise                         = randn(4,1D5);
noise                         = (noise-mean(noise,2))./repmat(std(noise,0,2),1,1D5);
noiseYieldsAll                = randn(40,1D5);
noiseYieldsAll                = (noiseYieldsAll-mean(noiseYieldsAll,2))./repmat(std(noiseYieldsAll,0,2),1,1D5);
setupFilter.shocks            = shocks(1:ne,:);
setupFilter.noise             = noise;
setupFilter.noiseYieldsAll    = noiseYieldsAll;
% save('shocksMyPC.mat','shocks')
% save('noiseMyPC.mat','noise')
% save('noiseYieldsAllMyPC.mat','noiseYieldsAll')
%tmp   = load('shocksMyPC.mat');
%tmpII = load('noiseMyPC.mat');
%tmpIII= load('noiseYieldsAllMyPC.mat');
%setupFilter.shocks            = tmp.shocks(1:ne,:);
%setupFilter.noise             = tmpII.noise;
%setupFilter.noiseYieldsAll    = tmpIII.noiseYieldsAll;
if lambdaSMM == 1
    setupFilter.lambdaSMM     = setupFilter.T;
else
    setupFilter.lambdaSMM     = 0;
end
setupFilter.pruningOn         = pruningOn;
setupFilter.dataMoments_mat   = dataSMM.dataMoments_mat;
setupFilter.qLag              = qLag;
setupFilter.inclSurveys       = inclSurveys;